let str='abacdef123456'
let ch0=str[2] //a
let ch=str.charAt(2) //传索引 默认值是0 c
let code=str.charCodeAt(2) //99
let ch1=String.fromCharCode(99) //c
let index=str.indexOf('a') //0 找不到就是-1

let res=str.substring(2) //acdef123456 2是索引 第二个参数结束索引
let res1=str.substring(2,8) //acdef1 第二个参数结束索引但是不包括
let res2=str.slice(1,3)  //ba  str.slice(beginindex ,[endindex])不包含endindex 默认从0开始，

let str1 = 'The quick brown fox jumps over the lazy dog.'
let arr=str1.split(' ') //字符串数组
let filename='1.2.3.txt'
let index1=filename.lastIndexOf('.')
console.log(filename.substring(index1+1)) //txt

let str3='http://www.baidu.com?uname=zs&age=22'
let tempArr=str3.split('?')[1].split('&') //[ 'uname=zs', 'age=22' ]
tempArr.forEach(element=>element=element.split('=')[1])
console.log(tempArr) //[ 'uname=zs', 'age=22' ]
console.log('-------------------------')
var arr = [10, 20, 30, 15, 50, 5]


//abcdefg=>gfedcba
let str2='abcdefg'
let res3=str2.split('').reverse().join('')
console.log(res3)
console.log(index1)
console.log(ch0)
console.log(ch) //c
console.log( code) //99 number类型
console.log(ch1)
console.log(index)
console.log(res)
console.log(res1)
console.log(res2)
console.log(str)